#ifndef FILAEMI_HPP_
#define FILAEMI_HPP_

#include "BaseQueueE.hpp"

namespace queue
{

	template<class T>
	class FilaEMI : public BaseQueueE<T>
	{
	public:
		
		FilaEMI( const unsigned int );
		
		~FilaEMI();
		
		void
		push();
		
	private:
		
		void
		shiftLeft();
		
	};

}

/*****************************
 * 
 *   Implementations....
 * 
 * 
 * **************************/

//public methods

template<class T>
queue::FilaEMI<T>::FilaEMI( const unsigned int _maxNodes )
{
	this->queue.resize( _maxNodes );
}

template<class T>
queue::FilaEMI<T>::~FilaEMI()
{
	this->clear();
}

template<class T> void
queue::FilaEMI<T>::push( cosnt T _info )
{
	if (! this->full() )
	{
		if (this->lastNode + 1 == this->queue.size() )
		{
			this->shiftLeft();
		}
		this->lastNode++;
		this->queue.at( lastNode ) = _info;
	}
	else
	{
		this->throwException("Queue is full",4);
	}
}

template<classT> void
queue::FilaEMI<T>::shiftLeft()
{
	if( this->firstNode > 0)
	{
		for( unsigned int counter = this->firstNode ; counter <= this->lastNode ; counter++ )
		{
			this->queue.at(counter - 1) = this->queue.at(counter);
		}
	}
	else
	{
		this->throwException()
	}
}

#endif /*FILAEMI_HPP_*/
